package com.huatai.saas.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huatai.saas.entity.ClientVersionEntity;
import com.huatai.saas.vo.ClientVersionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @program: nanming-saas
 * @description: 客户端版本数据持久层
 * @author: zcw
 * @create: 2024-04-17 16:20
 */
@Mapper
public interface ClientVersionMapper extends BaseMapper<ClientVersionEntity> {
	/**
	 * 分页获取客户端软件版本信息列表
	 * @param page 分页信息
	 * @return
	 */
	@Select("SELECT id,name,version_number,url,description,create_time,update_time FROM client_version ORDER BY create_time DESC")
	IPage<ClientVersionVO> listClientVersion(Page<ClientVersionVO> page);
	/**
	 * 根据版本号获取下载链接
	 * @param versionNumber 版本号
	 * @return
	 */
	@Select("SELECT url FROM client_version WHERE version_number=#{versionNumber}")
	String getUrlByVersionNumber(String versionNumber);
}
